home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mail / thor201.lha / THOR_2.0 / thor.lha / rexx / CfgUUCP.thor < prev    next >
Text File  |  1995-05-15  |  2KB  |  72 lines

  1. /* $VER: CfgUUCP.thor 0.5 (12.12.1994)
  2.  *
  3.  * External configuration for the UUCP bbstype.
  4.  *
  5.  *  Script by: Kjell Irgens, Ultima Thule Software.
  6.  */
  7.  
  8. parse arg argument
  9. options results
  10.  
  11. template = 'BBSNAME,CONFNAME/K,PUBSCREEN/K'
  12.  
  13. p=address()||' '||show('P',,);if pos('THOR.',p)>0 then thorport=word(,
  14. substr(p,pos('THOR.',p)),1);else do;say 'No THOR port found!';exit 10;end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     address command
  18.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  19.         "WaitForPort BBSREAD"
  20. end
  21.  
  22. address "BBSREAD"
  23.  
  24. READARGS template ARGS CMDLINE argument
  25. if rc ~= 0 then exit
  26.  
  27. GETBBSDATA bbsname '"'ARGS.BBSNAME'"' stem BBSDATA
  28. if rc ~= 0 then do
  29.     address(thorport)
  30.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  31.     exit 5
  32. end
  33.  
  34. address(thorport)
  35.  
  36. REQUESTNOTIFY TEXT '"Change configuration or headers?"' BT '"C_onfig|_Headers|_Cancel"'
  37.  
  38. if result = 1 then do
  39.     if ~open(file, BBSDATA.BBSPATH||"UUCPExtConfig", 'W') then do
  40.           address(thorport)
  41.         REQUESTNOTIFY '"Could not create config file."' '"_Ok"'
  42.         exit 0
  43.     end
  44.     call writeln(file, "2")
  45.  
  46.     REQUESTNOTIFY TEXT '"Use THOR as news reader\nor mail reader only?"' BT '"_News & Mail|_Mail only"'
  47.     if result = 1 then do
  48.         if(exists("uunews:")) then newsdir = "UUNews:"
  49.         else newsdir = ""
  50.         REQUESTFILE TITLE '"Select news directory:"' ID '"'newsdir'"' FP PAT '"~#?"'
  51.         call writeln(file, result)
  52.         REQUESTSTRING TITLE '"Command to use to post news (PostNews)?"' BT '"_Ok"' MAXCHARS 60
  53.         if(rc ~= 0) then call writeln(file, "postnews")
  54.         else call writeln(file, result)
  55.     end
  56.     else do
  57.         call writeln(file, "")
  58.         call writeln(file, "")
  59.     end
  60.     REQUESTSTRING TITLE '"Command to use to send of mail (SendMail)?"' BT '"_Ok"' MAXCHARS 60
  61.     if(rc ~= 0) then call writeln(file, "sendmail")
  62.     else call writeln(file, result)
  63.     exit 0
  64. end
  65. if result = 2 then do
  66.     REQUESTNOTIFY TEXT '"You may create extra header lines to appear\nin the editor when you write messages.\nFollowup-To: and Keywords: are good examples."' BT '"_Edit|_Delete|_Cancel"'
  67.     if result = 1 then do
  68.         STARTEDITOR FILE BBSDATA.BBSPATH||".header"
  69.     end
  70.     if result = 2 then address command "delete >NIL: "||BBSDATA.BBSPATH||".header"
  71. end
  72.